package edu.gdkm.demo3;

import java.util.Random;

public class Test2 {
    public static void main(String[] args) {

        int numbers[]=new int[50];
        for(int i=0;i< numbers.length;i++){
            numbers[i]=new Random().nextInt(100);
            System.out.print(numbers[i]+" ");
        }
        System.out.println();
        int max = 0;
        int min = 100;
        //遍历数组
        for(int i=0;i < numbers.length;i++){
            if(numbers[i]>max){
                max = numbers[i];
            }
            if(numbers[i]<min){
                min = numbers[i];
            }
        }
        System.out.println(max);
        System.out.println(min);
    }
}
